package com.bandit.service.impl;

import com.bandit.mapper.UserMapper;
import com.bandit.pojo.User;
import com.bandit.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public User getUserByID(int id) {
        return userMapper.getUserByID(id);
    }

    @Override
    public User getUserByName(String name){
        return userMapper.getUserByName(name);
    }

    @Override
    public List<User> getUserList(User user) {
        return userMapper.getUserList(user);
    }

    @Override
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public int deleteUserByID(int id) {
        return userMapper.deleteUserByID(id);
    }

    @Override
    public int deleteUserByIDS(String[] ids) {
        return userMapper.deleteUserByIDS(ids);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }
}
